package org.mipt.infsec.steganography.parameters;

import javax.swing.*;
import java.awt.*;

public class Parameters {
	public static final String PROGRAM_VERSION = "1.0";
	public static final int PROGRAM_BUILD = 1;
	public static final int PROGRAM_YEAR = 2011;
	public static final String PROGRAM_AUTHOR = "PetZib";
    public static String PROGRAM_NAME = "Steganografia";
    public static String MESSAGE_IO_ERROR = "I/O error occured";
    public static int GUIFRAME_WIDTH = 550;
	public static int GUIFRAME_HEIGHT = 550;

    public static String MESSAGE_ENCRYPTION_COMPLETED = "Encryption completed";
	public static String MESSAGE_UNEXPECTED_ERROR = "Unexpected error occurred";

    public static void showErrorMessage(Component comp, String mes, String errMes) {
        JOptionPane.showMessageDialog(comp, mes + "\n\n Error message: \n\n" +"<html><textarea cols = 20 rows = 2>" + errMes.replaceAll("[\n\r]", " ") + "</textarea></html>", Parameters.PROGRAM_NAME, JOptionPane.ERROR_MESSAGE);
    }
    public static void showInformationMessage(Component parentComponent, String message) {
		JOptionPane.showMessageDialog(parentComponent, message, Parameters.PROGRAM_NAME, JOptionPane.INFORMATION_MESSAGE);
	}

public static void showAbout(Component parentComponent) {
		JOptionPane.showMessageDialog(parentComponent,
				"<html><b>"
					+"<h3>"+Parameters.PROGRAM_NAME+"</h3>"
					+"<br>Version: "+Parameters.PROGRAM_VERSION+"."+Parameters.PROGRAM_BUILD+"</b></html>\n\n"
					+"<html>"
					+"&#169; "+Parameters.PROGRAM_YEAR+" by "+Parameters.PROGRAM_AUTHOR
					+"<br>&nbsp;</html>",
				"About", JOptionPane.INFORMATION_MESSAGE);
	}


}
